
 <html>
<head>
<title>{$result.name}</title>
    <script src="__STYLE__/js/jquery.min.js"></script>    
    <script src="__STYLE__/js/bootstrap.min.js"></script>  
    <link href="__STYLE__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__STYLE__/css/animate.min.css" rel="stylesheet">
    <link href="__STYLE__/css/style.css" rel="stylesheet">
</head>
<body>
    
<include file="Public:header" />

						<div class="container">
							<div class="row clearfix margin4">
								<div class="col-xs-6 column margin1 padding10">
									<form class="form-horizontal"  method="POST"  action="__ROOT__/index.php/home/form/addcart">
										<fieldset>

										<!-- 表单名称 -->
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;"><h4><b>{$result.name}</b></h4></label>
										</div>	
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">price</label>
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;">￥{$result.price}</label>
										  <input type="hidden" id="danjia" class="form-control" name="price" value="{$result.price}">
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">description</label>
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;">{$result.description}</label>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">size</label>
										  <div class="col-xs-offset-3 col-xs-4" style="text-align:left;">
										  	<select id="size" name="size" class="form-control">
										      <option value="xs">xs</option>
										      <option value="s">s</option>
										      <option value="m">m</option>
										      <option value="xs">l</option>
										      <option value="s">xl</option>
										      <option value="m">xll</option>
										    </select></div>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">number</label>
										    <div class="col-xs-offset-3 col-xs-4">
												<div class="input-group">
													<span class="input-group-btn">
															<button type="button" class="btn button2 btn-number"  data-type="minus" data-field="number" style="padding-top: 9px;padding-bottom: 9px;">
																	<span class="glyphicon glyphicon-minus"></span>
															</button>
													</span>
													<input type="text" name="number" id="number" class="form-control input-number" value="1" min="1" max="100">
													<span class="input-group-btn">
															<button type="button" class="btn button2 btn-number" data-type="plus" data-field="number"  style="padding-top: 9px;padding-bottom: 9px;">
																	<span class="glyphicon glyphicon-plus"></span>
															</button>
													</span>
											</div>

											</div>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">total price</label>
										  <label class="col-xs-offset-3 col-xs-9 control-label" style="text-align:left;" id="zongjia"></label>
										</div>
										<?php
											if(!isset($_SESSION['username'])){
		                                    echo'
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-xs-3 control-label" for="singlebutton">提交</label>
										  <div class="col-xs-9">
										    <a href="__ROOT__/index.php/home/form/login"><input id="singlebutton" name="singlebutton" class="btn btn-primary" value="请登录后购买"></a>
										  </div>
										</div>'; 
											}
											else{
										echo'<input type="hidden" id="drclothesid" class="form-control" name="drclothesid" value="'.$result['id'].'">
											<input type="hidden" id="username" class="form-control" name="username" value="'.$_SESSION['username'].'">
											<input type="hidden" id="img" class="form-control" name="img" value="'.$result['img'].'">
											<input type="hidden" id="name" class="form-control" name="name" value="'.$result['name'].'">
											<input type="hidden" id="price" class="form-control" name="price" value="'.$result['price'].'">
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-xs-3 control-label" for="singlebutton"></label>
										  <div class="col-xs-9">
										    <input id="singlebutton" type="submit" name="singlebutton" class="btn btn-primary button2"  value="购买">
										  </div>
										</div>';
                      						  }?>
										</fieldset>
									</form>
								</div>
								<div class="col-xs-6 column padding1" align="center">
									<img src="__STYLE__/{$result.img}" class="img-responsive ">
								</div>
							</div>
						</div>
 
<include file="Form:comment" />

<include file="Public:footer" />
</body>
</html>
<script src="__STYLE__/js/btn-number.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#zongjia").html("￥{$result.price}");
    $("#number").change(function() {
    	var val = document.getElementById("number").value;
    	var danjia = document.getElementById("danjia").value;
    	$("#zongjia").html(val*danjia);
    });
})
</script>